Skip to content

feat(decisioning): add full stack registry factory#765

Open
sangilish wants to merge 2 commits into
adcontextprotocol:mainfrom
sangilish:feat/pg-registry-full-stack-697
Open

feat(decisioning): add full stack registry factory#765
sangilish wants to merge 2 commits into
adcontextprotocol:mainfrom
sangilish:feat/pg-registry-full-stack-697

Conversation

@sangilish
Copy link
Copy Markdown
Contributor

@sangilish sangilish commented May 20, 2026

Summary

Closes #697.

This adds PgBuyerAgentRegistry.with_full_stack() as the one-call factory for the documented production wrapper order: Caching(RateLimited(Auditing(pg))).

What changed

  • Added with_full_stack() to PgBuyerAgentRegistry.
  • Builds the canonical cache -> rate-limit -> audit stack while returning the outer CachingBuyerAgentRegistry.
  • Threads audit_sink and sink_timeout_seconds through all three layers.
  • Shares time_source between cache and rate limiter for deterministic tests.
  • Wires Pg mutations through this registry instance to clear the returned cache.
  • Documents the fixed layer order and points adopters with non-default ordering needs to manual composition.

Testing

  • uv run ruff check src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.py
  • uv run mypy src/adcp/decisioning/pg/buyer_agent_registry.py
  • ADCP_PG_TEST_URL=postgresql://postgres:pg@127.0.0.1:55432/postgres uv run python -m pytest tests/conformance/decisioning/test_pg_buyer_agent_registry.py -q
  • uv run python -m pytest tests/test_buyer_agent_registry_cache.py -q

@sangilish sangilish marked this pull request as ready for review May 20, 2026 23:29
@sangilish
Copy link
Copy Markdown
Contributor Author

This is ready for review now. CI is green, and I kept the change scoped to #697: the documented Caching(RateLimited(Auditing(pg))) factory with mutation invalidation and audit/rate-limit coverage.

@bokelley
Copy link
Copy Markdown
Contributor

Thanks for the heads-up — noted. The PR is queued for human review; a maintainer will pick it up from here.


Triaged by Claude Code. Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}


Generated by Claude Code

@bokelley
Copy link
Copy Markdown
Contributor

Local spot-check from triage: the implementation remains scoped to #697, and python3 -m ruff check src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.py passes. The targeted Postgres conformance file skipped in this workspace because the PG fixture is not available, so CI remains the DB-backed validation source.\n\nOrdering note: #764 and this PR both edit PgBuyerAgentRegistry and the same conformance file. A synthetic merge of #764 and #765 shows conflicts, so recommendation is to merge #764 first, then update/rebase this branch and merge #765 second.

@bokelley
Copy link
Copy Markdown
Contributor

Acknowledged — thanks for the spot-check and the merge-order note, @bokelley.

#764 is still open, so this branch can't be rebased cleanly yet. Once #764 merges into main, I'll rebase feat/pg-registry-full-stack-697 on top of the updated main and resolve any conflicts before this PR proceeds.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(buyer-agent-registry): with_full_stack() — compose caching + rate-limiting + auditing in one factory

2 participants